import React from 'react'
import store from '../../store/store'
import { getMovieList } from '../../store/actions/movieAction'
export default function Movie() {
  const { count } = store.getState().count
  const { movieList } = store.getState().movie
  const getMovieListHandle=()=>{
    store.dispatch(getMovieList())
  }
  return (
    <div>
      <hr />
      <p>如果count增加我也跟着增加{count}</p>
      <p>电影的数量{movieList.length}</p>
      <button onClick={getMovieListHandle}>获取电影的数据</button>
      <ul>
        {
          movieList.map(item=>{
            return <li key={item.tvId}>{item.albumName}</li>
          })
        }
      </ul>
    </div>
  )
}
